package com.us.usws.site.ws.entity.theme;

import java.util.Date;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonPropertyOrder;

import com.us.usws.biz.WSResourceURIReplacer;
import com.us.usws.model.domain.Meeting;

@JsonPropertyOrder({ "id", "room_id", "title", "content", "start_time", "status", "presenter", "snapshot", "url" })
public class WSThemeMeeting {

	@JsonProperty("id")
	private String uid;

	@JsonProperty("room_id")
	private String confRoomId;

	private String title;

	private String content;

	@JsonProperty("start_time")
	private Date startDate;

	private int status;

	private WSThemeMeetingUser presenter;

	private String snapshot;
	private String url;

	@JsonIgnore
	private int type;
	@JsonIgnore
	private Date endDate;

	public WSThemeMeeting(Meeting m) {
		this.uid = m.getUid();
		this.confRoomId = m.getConfRoomId();
		this.title = m.getTitle();
		this.content = m.getContent();
		this.startDate = m.getStartDate();
		this.endDate = m.getEndDate();
		this.type = m.getTypeDsid();
		this.status = m.getStatusDsid();

		this.snapshot = WSResourceURIReplacer.getMeetingSnapshotURL(m.getUid(), m.getPicture());
		this.url = WSResourceURIReplacer.getMeetingInfoUrl(m.getUid());

		this.presenter = new WSThemeMeetingUser(m.getPresenterUid(), m.getPresenterName());
	}

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getConfRoomId() {
		return confRoomId;
	}

	public void setConfRoomId(String confRoomId) {
		this.confRoomId = confRoomId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public WSThemeMeetingUser getPresenter() {
		return presenter;
	}

	public void setPresenter(WSThemeMeetingUser presenter) {
		this.presenter = presenter;
	}

	public String getSnapshot() {
		return snapshot;
	}

	public void setSnapshot(String snapshot) {
		this.snapshot = snapshot;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}
